package com.tea.dhcBatis.sqlSession.impl;

import com.tea.dhcBatis.cfg.Configuration;
import com.tea.dhcBatis.sqlSession.SqlSession;
import com.tea.dhcBatis.sqlSession.SqlSessionFactory;

public class SqlSessionFactoryImpl implements SqlSessionFactory {

    private Configuration cfg;
    public SqlSessionFactoryImpl(Configuration cfg) {
        this.cfg = cfg;
    }

    /**
     * 用于创建一个新的操作数据库对象
     * @return
     */
    public SqlSession openSession() {
        return new SqlSessionImpl(cfg);
    }
}
